package apidoc;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class exezmp4 {
        public static void main(String[] args) {
            String inputFilePath = "./主线设计演示.mp4";
            String outputFilePath = "./主线设计演示（纬地软件操作视频）.exe";

            try {
                ProcessBuilder processBuilder = new ProcessBuilder("ffmpeg", "-i", inputFilePath, outputFilePath);
                Process process = processBuilder.start();

                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                String line;
                while ((line = reader.readLine()) != null) {
                    System.out.println(line);
                }

                int exitCode = process.waitFor();
                if (exitCode == 0) {
                    System.out.println("Video conversion successful!");
                } else {
                    System.out.println("Video conversion failed!");
                }

            } catch (IOException | InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

